#define _CRT_SECURE_NO_WARNINGS 1

class Sum
{
public:
    Sum()
    {
        _sum += ++_count;
    }
    int GetSum()
    {
        return _sum;
    }
    ~Sum()
    {
        _sum -= --_count;
    }
private:
    static int _count;
    static int _sum;
};
int Sum::_count = 0;
int Sum::_sum = 0;

class Solution {
public:
    int Sum_Solution(int n) {
        Sum arr[n - 1];
        return Sum().GetSum();
    }
};